<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_vast_login
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
?>
<ul>
    <li>
        <?php if ($type == 'login'): ?>
        <a>Đăng nhập</a>
        <?php else: ?>
        <a>Thông tin đăng nhập</a>        
        <?php endif; ?>
    </li>
    <ul>
        <?php if ($type == 'logout') : ?>
        <li>
            <form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="login-form">
            <?php if ($params->get('greeting')) : ?>
            	<div class="login-greeting" style="padding: 5px; margin-top: 5px; margin-bottom: 5px;">
                <table style="border: 0; padding: 0; margin: 0;">
                    <tr>
                        <td>
                            <?php if (isset($canbo) && $canbo !== NULL): ?>
                            <img title="<?php echo $canbo->hoten; ?>" alt="<?php echo $canbo->hoten; ?>" width="40" height="40" src="<?= file_exists($canbo->anhdaidien) ? $canbo->anhdaidien : JURI::base() . '/media/com_vast/images/www.vast.ac.vn.gif' ?>"/>
                            <?php endif; ?>
                        </td>
                        <td>
                        	<?php if($params->get('name') == 0) : {
                        		echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('name')));
                        	} else : {
                        		echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('username')));
                        	} endif; ?>
                            <br />
                            <?php if (isset($canbo) && $canbo !== NULL): {
                                echo $canbo->hoten;    
                            }
                            endif; ?>
                            
                        </td>
                    </tr>
                </table>
            	</div>
            <?php endif; ?>
            	<div class="logout-button" style="padding: 5px; margin-top: 5px; margin-bottom: 5px;">
            		<input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGOUT'); ?>" />
            		<input type="hidden" name="option" value="com_users" />
            		<input type="hidden" name="task" value="user.logout" />
            		<input type="hidden" name="return" value="<?php echo $return; ?>" />
            		<?php echo JHtml::_('form.token'); ?>
            	</div>
            </form>
        </li>
        <?php else : ?>
        <li>
            <form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="login-form" >
            	<?php if ($params->get('pretext')): ?>
            		<div class="pretext">
            		<p><?php echo $params->get('pretext'); ?></p>
            		</div>
            	<?php endif; ?>
            	<fieldset class="userdata" style="padding: 5px; margin-top: 5px; margin-bottom: 5px;">
                <table style="padding: 0; border: 0; margin: 0;">
                    <tr>
                        <td>
                    		<label for="modlgn-username"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?></label>                
                        </td>
                        <td>
                    		<input id="modlgn-username" type="text" name="username" class="inputbox"  size="18" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                    		<label for="modlgn-passwd"><?php echo JText::_('JGLOBAL_PASSWORD') ?></label>
                        </td>
                        <td>
                    		<input id="modlgn-passwd" type="password" name="password" class="inputbox" size="18"  />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        	<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
                    		<label for="modlgn-remember"><?php echo JText::_('MOD_LOGIN_REMEMBER_ME') ?></label>
                    		<input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/>
                        	<?php endif; ?>
                        </td>
                        <td>
                        	<input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGIN') ?>" />
                        </td>
                    </tr>
                </table>
            	<input type="hidden" name="option" value="com_users" />
            	<input type="hidden" name="task" value="user.login" />
            	<input type="hidden" name="return" value="<?php echo $return; ?>" />
            	<?php echo JHtml::_('form.token'); ?>
            	</fieldset>
            	<?php if ($params->get('posttext')): ?>
            		<div class="posttext">
            		<p><?php echo $params->get('posttext'); ?></p>
            		</div>
            	<?php endif; ?>
            </form>
        </li>
        <?php endif; ?>    
    </ul>
</ul>